package org.datastructure.firstday.tree;

public class treeTest {

    public static void main(String[] args) {
        HeroNode root = new HeroNode(1, "宋江");
        HeroNode heroNode2 = new HeroNode(2, "2");
        HeroNode heroNode3 = new HeroNode(3, "3");
        HeroNode heroNode4 = new HeroNode(4, "4");
        HeroNode heroNode5 = new HeroNode(5, "5");

        root.setLeft(heroNode2);
        root.setRight(heroNode3);
        heroNode3.setLeft(heroNode4);
        heroNode3.setRight(heroNode5);

        BinaryTree binaryTree = new BinaryTree();
        binaryTree.setRoot(root);
   /*     System.out.println("--------前序--------");
        binaryTree.preOrder();
        System.out.println("--------中序---------");
        binaryTree.infixOrder();
        System.out.println("---------后续--------");
        binaryTree.postOrder();

        System.out.println(binaryTree.preOrderSearch(5));

        System.out.println(binaryTree.infixOrderSearch(5));

        System.out.println(binaryTree.postOrderSearch(5));*/
        binaryTree.preOrder();
        binaryTree.delHero(3);
        binaryTree.preOrder();
    }
}
